<?php

namespace App\Services\Base;
use App\Params\Backend\LogListParam;
use App\Repository\ApiLogRepository;
use App\Services\BaseService;

/**
 * 接口日志相关业务类
 *
 * @author WangBin
 * @date 2022-01-13
 * @package App\Http\Services
 */
class ApiLogService extends BaseService
{
    /**
     * 查询日志列表
     *
     * @param LogListParam $param
     * @return array
     */
    public function getList(LogListParam $param)
    {
        $columns = ['api_log_id', 'title', 'api_url', 'remote_ip', 'start_time', 'end_time', 'run_time', 'status', 'created_at'];
        $result = ApiLogRepository::getInstance()->getList($param->toArray(), $columns);
        return $this->toList($result, $param->getPage(), $param->getPageSize());
    }
}
